POV-Ray : Newsgroups : povray.general : Nested #switch...#end blocks - strange behaviour! : Re: Nested #switch...#end blocks - strange behaviour! Server Time
1 Aug 2024 02:22:10 EDT (-0400)
  Re: Nested #switch...#end blocks - strange behaviour!  
From: Chris B
Date: 15 May 2006 20:01:26
Message: <44691656$1@news.povray.org>
"Bob H" <omniverse@charter%net> wrote in message 
news:44690d4b@news.povray.org...
> Curious thing... apparently it's the mod() doing it because when I 
> replaced that part with #declare clock2=1; it works (likewise if 
> clock2=2). And I haven't a clue why it would happen like that.
>

Hi Bob,

I think it's just the usual rounding errors. If you use the integer part of 
the result it works:

    int(mod(clock*10,10))

The cause didn't show up when you used
  #warning concat("clock2 = ", str(clock2, 1, 0))
because this specifies 0 decimal places.
It shows up if you do str(clock2, 1, 30)

Regards,
Chris B.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.